package com.eric.domain.vo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SupplierVO  {

    private Integer id;

    @NotBlank(message = "The supplierName can be blank")
    @Pattern(regexp = "^(?:[\\u4e00-\\u9fa5·]{2,16}|[A-Za-z][A-Za-z' -]{1,24})$",message = "the supplierName is wrong")
    private String supplierName;

    @NotBlank(message = "The supplierPhone can be blank")
    @Pattern(regexp = "^(?:\\+86[-\\s]?)?(?:1[3-9]\\d{9}|0\\d{2,3}[-\\s]?[1-9]\\d{6,7})$",message = "the telephone code is wrong")
    private String supplierPhone;

    @NotBlank(message = "The supplierContact can be blank")
    @Pattern(regexp = "^(?:[\\u4e00-\\u9fa5·]{2,16}|[A-Za-z][A-Za-z' -]{1,24})$",message = "the supplierContact is wrong!")
    private String supplierContact;

    @Pattern(regexp = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", message = "错误的电子邮箱格式！")
    private String email;

    private String address;

    private String invoiceInfo;

    private String description;
}
